Some items such as tables, views, joins or aggregations can be materialized into the DWH. The materialized tables will be used by our optimizer to rewrite queries and redirect them to the DWH instead of the original data source.
Choose the parameters for a Materialization Job to be created
Advanced options:
A complete load job may automatically create indexes. This behavior is controlled by a set of radio buttons:
This type of job can trigger native statistics gathering once replication is finished.
An incremental job checks what rows where added using a row check expression or table column. Optionally, it allows to check if old rows where changed to avoid duplications by specifying an identity expression or table column.
Which rows are new can be calculated by either
value > MAX(field) of the already
loaded data will be considered new and transferred to the Analytical StorageSQL expression examples
In all examples we assume that the table in the data source has a
column called
lastTimestamp
which contains the timestamp of the last update of the data in the
corresponding row:
max(lastTimestamp) - updates all data starting
from the last date/time when the Analytical Storage was updated.
Alternatively, you can just select the field lastTimestamp
in the dropdown boxcast(max(lastTimestamp) as date) - updates all
data starting from 0:00 on the day the Analytical Storage was last
updatedmax(year(lastTimestamp)*100+month(lastTimestamp))
- updates all data starting from 0:00 on the 1st day of the month
when the Analytical Storage was last updatedcast(timestampAdd(SQL_TSI_DAY,-1,max(lastTimestamp))
as date) - updates data starting from 0:00 one day before the
Analytical Storage was last updatedIn some cases, the original table may have been updated by editing an existing row with a new value. If this new value passes new row check, it will be inserted into the materialized table, breaking its consistency (i.e. a constraint violation because of primary key duplication).
To avoid unnecessary data duplication, the incremental job offers an optional identity check field or expression.
Before inserting a new value, the job will ensure that the value identity field or expression is unique for this row. Otherwise, the existing row will be updated instead. The most practical is to specify a primary key field as identity check to ensure consistency and to avoid duplications.
If this option is checked, the incremental job will delete and update all the rows in the materialized table that match the value of the newRowCheckExpression. When this option is unchecked, the incremental job doesn't delete these rows from the materialized table and only adds the new ones.
By default this option is enabled.
This type of job can trigger native statistics gathering once replication is finished.